
<%@page import="pucit.carDao"%>
<%@page import="java.util.Hashtable"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
      
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Diminishing   by Free CSS Templates</title>
        <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
 
        
    </head>
    <body>
        <%! ArrayList<Hashtable<String, String>> cars; 
            Hashtable<String, String> car;%>
        <%
            if(session.getAttribute("username") == null || !session.getAttribute("username").toString().equals("admin")){
                session.setAttribute("msg", "Only admin can delete a car!");
                response.sendRedirect("signin.jsp");
            }else{
                carDao dao = new carDao();
                cars = dao.getAvailableCars();
              
        %>
        
        <div id="wrapper">
	<div id="menu">
		<ul>
			<li class="current_page_item"><span><a href="index.jsp">Home</a></span></li>
			<li ><a href="signin.jsp">Sign in</a></li>
			<li><a href="update.jsp">Update Profile</a></li>
			<li><a href="intro.jsp">About</a></li>
			<li><a href="reserve.jsp">Reserve Car</a></li>
			<li><a href="contact.jsp">Contact</a></li>
		</ul>
	</div>
	<!-- end #menu -->
	<div id="header">
		<div id="logo">
			<h1><a href="#">Rent A Car</a></h1>
		</div>
		<div id="search">
			<form method="get" action="">
				<fieldset>
					<input type="text" name="s" id="search-text" size="15" value="enter keywords here..." />
					<input type="submit" id="search-submit" value="GO" />
				</fieldset>
			</form>
		</div>
	</div>
	<div id="splash">&nbsp;</div>
	<!-- end #header -->
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="content">
                                    
                                    <h2 color: #2C2723;>Delete A Car</h2>
        
        
        
        <% 
            for (int i=0; i<cars.size(); i++){
                car = cars.get(i);
            
                %>
        <form method="get" action="carcontroller">
            <input type="hidden" name="action" value="deleteCar"/>
            <input type="hidden" name="carId" value="<%= car.get("id") %>"/>
            <table>
                <tr>
                    <td>Car Name:</td>
                    <td><%= car.get("carname") %></td>
                </tr>
                <tr>
                    <td>Model:</td>
                    <td><%= car.get("model") %></td>
                </tr>
                <tr>
                    <td>Registration No.:</td>
                    <td><%= car.get("numberplate") %></td>
                </tr>
                <tr>
                    <td>Rent:</td>
                    <td>Rs.<%= car.get("rent") %>/- per day</td>
                </tr>
                <tr>
                    <td>Status:</td>
                    <td><div style="color:green;font-weight:bold">Available</div></td>
                </tr>

                <tr>
                    <td colspan="2"><input type="submit" value="Delete this car!"/>
                </tr>
            </table>
        </form>
                <%}%>
        
        
                            <h3><a href="index.jsp">Back</a></h3>
				</div>
				<!-- end #content -->
				<div id="sidebar">
					<ul>
						<li>
							<h2>Solution of pollution</h2>
							<p>Pollution is a big problem of today whether it is air or noise. Environmentalists embrace hybrid cars as a solution to today's pollution problems.</p>
						</li>
						<li>
							<h2>Branches</h2>
							<ul>
								<li><a href="contact.jsp">Lahore Branch</a></li>
								<li><a href="karachi.jsp">Karachi Branch</a></li>
								<li><a href="isl.jsp">Islamabad Branch</a></li>
								<li><a href="faisal.jsp">Faisalabad Branch</a></li>
								<li><a href="rawal.jsp">Rawalpindi Branch</a></li>
								
							</ul>
						</li>
						<li>
							<h2>Menu</h2>
							<ul>
								<li><a href="hybrid.jsp">Hybrid Cars</a></li>
								<li><a href="addcar.jsp">Add cars</a></li>
								<li><a href="#">Delete Cars</a></li>
								<li><a href="freeCars.jsp">Make Car Reserved free</a></li>
								<li><a href="#">Beautiful Photos</a></li>
							</ul>
						</li>
						
					</ul>
				</div>
				<!-- end #sidebar -->
				<div style="clear: both;">&nbsp;</div>
			</div>
		</div>
	</div>
	<!-- end #page -->
</div>
<div id="footer-wrapper">
	<div id="three-columns">
		<div id="column1">
			<h2>Branches</h2>
			<ul>
				<li><a href="contact.jsp">Lahore Branch</a></li>
				<li><a href="karachi.jsp">Karachi Branch</a></li>
				<li><a href="isl.jsp">Islamabad Branch</a></li>
				<li><a href="faisal.jsp">Faisalabad Branch</a></li>
				<li><a href="rawal.jsp">Rawalpindi Branch</a></li>
				
			</ul>
		</div>
		<div id="column2">
			<h2>Menu</h2>
			<ul>
				<li><a href="hybrid.jsp">Hybrid Cars</a></li>
				<li><a href="addcar.jsp">add cars</a></li>
				<li><a href="#">Delete Cars</a></li>
				<li><a href="freeCars.jsp">Make Car Reserved free</a></li>
				<li><a href="#">Beautiful Photos</a></li>
		</div>
		
	</div>
	<div id="footer">
		<p>Copyright (c) 2011 Sitename.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/"> CSS Templates</a>.</p>
	</div>
	<!-- end #footer -->
</div>

<% } %>
</body>
</html>
